package com.qh.yyxt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qh.yyxt.pojo.entity.thing.Thing;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ThingMapper extends BaseMapper<Thing>
{
    //添加物品
    public int addThing(Thing thing);
    //修改num
    public int updateNum(Integer id,Integer num,Integer renum);
    //删除一件物品
    public int delete(Integer id);
    //修改信息
    public int updateInfo(Thing thing);
    //根据id查询
    public Thing findById(Integer id);
    //查询所有
    public List<Thing>findAll();
    //Integer symbol 为null 就是增加 不为null就是减少
    public int updateNumBySymbol(Integer id,Integer renum,Integer symbol);
    //按类别查询
    public  List<Thing>findAllByType(int flag);
}
